Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate Hardware watchdog #11

Merged
merged 3 commits into from
Oct 26, 2020
Merged

Activate Hardware watchdog #11

merged 3 commits into from
Oct 26, 2020

Conversation

ThomTrab
Copy link
Contributor

Activate Hardware Watchdog in Ansible config
Add configuration file for Watchdog

ansible/site.yml Outdated
@@ -111,6 +111,30 @@
shell: bash -c "source /root/.acme.sh/acme.sh.env; /root/.acme.sh/acme.sh --install-cert -d {{ acolock_hostname }} --key-file /etc/nginx/{{ acolock_hostname }}.key --fullchain-file /etc/nginx/{{ acolock_hostname }}.cer --reloadcmd \"systemctl reload nginx\""
tags: certificate

- name: Enable Hardware Watchdog
shell: bash -c "echo 'dtparam=watchdog=on' >> /boot/config.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les playbooks sont généralement faits pour pouvoir être lancés plusieurs fois. Là à chaque lancement il va ajouter la ligne dans la config. C'est probablement pas bloquant, mais c'est pas super.

On pourrait modifier le script shell pour qu'il n'ajoute la ligne que si elle n'est pas déjà présente. Mais une solution plus propre c'est d'utiliser lineinfile par exemple.

shell: bash -c "echo 'dtparam=watchdog=on' >> /boot/config.txt"
#Need to reboot the machine before continue

- name: Reboot the machine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idéalement on aimerait qu'il ne reboot que si la ligne au dessus a effectivement été ajoutée. C'est pas indispensable mais c'est plus agréable.

Il y a ce tuto par exemple qui explique comment faire : https://raymii.org/s/tutorials/Ansible_-_Only-do-something-if-another-action-changed.html.

ansible/site.yml Outdated Show resolved Hide resolved
ThomTrab and others added 2 commits October 26, 2020 18:02
Co-authored-by: Michaël Witrant <mike@lepton.fr>
Condition reboot at Hardware Watchdog activation at boot
@ThomTrab ThomTrab merged commit d99731e into acolab:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants